(navigation image)
Home Animation & Cartoons | Arts & Music | Community Video | Computers & Technology | Cultural & Academic Films | Ephemeral Films | Movies | News & Public Affairs | Prelinger Archives | Spirituality & Religion | Sports Videos | Television | Videogame Videos | Vlogs | Youth Media
Search: Advanced Search
Anonymous User (login or join us) Upload

View movie

[item image]
View thumbnails
Run time: 11 minutes 31 seconds

Play / Download (help[help])

(13.4 M)Ogg Video
(23.8 M)h.264
(28.9 M)QuickTime


All Files: HTTP
[Attribution-Noncommercial-Share Alike 3.0]

Resources

Bookmark

Johan Falk/NodeOneLearn Drupal 13g: Cleanup in save function

You are using our new video/audio player!
I prefer flash (when possible)
Give us feedback!

This screencast is a part of the epic learning series "Four weeks of Drupal", chapter "Writing a module". You can view the full series at http://dev.nodeone.se/en/four-weeks-of-drupal.

Please post any comments over there, or we won't see them. Sorry.
---
This screencast present little new information about writing Drupal modules, but shows some cleanup work for the Word list configuration page รข allowing it to take care of unexpected data.
Some Drupal specific topics included in this screencast:
* Using the t() function with replacements
* Using the Drupal equivalent of strlen (and other str functions)
* Seeing Coder react on bad code
* Discussion on where to add cleanup logic

code changes in wordlist.module

function wordlist_save_list(array $words) {
// Check if the list of words contain any empty strings, and remove them.
$removed = 0;
foreach ($words as $key => $word) {
if (drupal_strlen($word) == 0) {
unset($words[$key]);
$removed++;
}
}

// If any strings were removed, notify the user.
if ($removed > 0) {
drupal_set_message(t(
'Removed @number empty words.',
array('@number' => $removed))
);
}

// Store the words in the variables table.
variable_set('wordlist_words', $words);
}

---
This screencast is a part of the epic learning series "Four weeks of Drupal", chapter "Writing a module". You can view the full series at http://dev.nodeone.se/en/four-weeks-of-drupal.

Please post any comments over there, or we won't see them. Sorry.


This movie is part of the collection: Community Video

Producer: Johan Falk/NodeOne
Audio/Visual: sound
Keywords: Drupal; 4 weeks of Drupal; NodeOne; coding

Creative Commons license: Attribution-Noncommercial-Share Alike 3.0


Individual Files

Movie Files QuickTime h.264 Ogg Video
Drupal 13g - Save cleanup 28.9 MB
23.8 MB
13.4 MB
Image Files Animated GIF Thumbnail
Drupal 13g - Save cleanup 246.9 KB
5.8 KB
Information FormatSize
LearnDrupal13gCleanupInSaveFunction_files.xml Metadata [file]
LearnDrupal13gCleanupInSaveFunction_meta.xml Metadata 2.2 KB

Be the first to write a review
Downloaded 41 times
Reviews


Terms of Use (10 Mar 2001)